package Code;

import java.util.HashMap;
import java.util.Map;

public class Code283 {
    static void moveZero(int[] nums) {
        int i = 0, j = 0;
        for (; i < nums.length; i++) {
            if (nums[i] != 0) {
                nums[j++] = nums[i];

            }
        }
        for (i = j; i < nums.length; i++) {
            nums[i] = 0;
        }

    }

    public static void main(String[] args) {
        int[] nums = {4, 0, 2, 1};
        moveZero(nums);
        for (int num: nums) {
            System.out.println(num);
        }
    }
}
